<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:background-color="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>决策树算法</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/data_plat.css}"/>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.js"></script>
</head>

<!--<style>-->
<!--label {-->
<!--height: 40px;-->
<!--}-->
<!--</style>-->
<body>

<input id="move_back" type=button value=后退 onclick="window.history.back()"><br>

<div  id="form-first">
    <div style="height: 50px;font-size: 30px;text-align: center;font-weight: 600" th:text="${algoName} + '算法结果预览'">
    </div>
    <div>
        模型唯一id：<input class="form-control" type="text" th:value="${classifierResult.modelId}" name="modelId"></span><br>
    </div>
    <div>
        算法名字：<input class="form-control" type="text" th:value="${classifierResult.algoName}" name="algoName"></span><br>
    </div>
    <div>
        参数：<textarea class="form-control" style="width: 100%;resize: none;" type="text" rows="10" th:text="${classifierResult.param}" name="param"></textarea></span><br>
    </div>
    <div>
        app名称：<input class="form-control" type="text" th:value="${classifierResult.appName}" name="appName"></span><br>
    </div>
    <div>
        数据摘要概要：
        <textarea name="info" type="text"  style="width: 100%;resize: none;" rows="10" class="form-control" th:text="${classifierResult.info}"></textarea><br>
    </div>
    <div>
        <!--数据统计学描述：<input class="form-control" type="text" th:value="${algoResult.describ}" name="appName"></span><br>-->
        数据统计学描述：
        <textarea name="describ" type="text"  style="width: 100%;resize: none;" rows="10" class="form-control" th:text="${classifierResult.describ}"></textarea><br>
    </div>
    <div>
        <div id="personal_result_image"></div>
    </div>
    <div>
        运行状态：<input class="form-control" type="text" th:value="${classifierResult.status}" name="status"></span><br>
    </div>
    <div>
        运行开始时间：<input class="form-control" type="text" th:value="${#dates.format(classifierResult.startTime,'yyyy-MM-dd hh:mm:ss')}" name="startTime"></span><br>
    </div>
    <div>
        运行结束时间：<input class="form-control" type="text" th:value="${#dates.format(classifierResult.endTime,'yyyy-MM-dd hh:mm:ss')}" name="endTime"></span><br>
    </div>
    <div>
        运行时长：<input class="form-control" type="text" th:value="${classifierResult.duration} + '秒'" name="duration"></span><br>
    </div>
</div>

<!--决策树个性化展示部分-->
<div id="decision_tree_class_result_imgage" style="display: none">
    <di>
        决策树绘制图： <br>
        <iframe th:src="'/pdf/'+${classifierResult.predDisImage}" width="100%" height="400px"></iframe><br>
    </di>
    <div>
        特征变量的重要程度：
        <textarea name="modelData" type="text"  style="width: 100%;resize: none;" rows="4" class="form-control" th:text="${classifierResult.modelData}"></textarea><br>
    </div>
    <div>
        评价指标-准确率：<input class="form-control" type="text" th:value="${classifierResult.evalValue}" name="evalValue"></span><br>
    </div>
</div>

<!--逻辑回归个性化展示部分-->
<div id="logistics_reg_class_result_imgage" style="display: none">
    <div>
        特征变量的重要程度：
        <textarea name="modelData" type="text"  style="width: 100%;resize: none;" rows="4" class="form-control" th:text="${classifierResult.modelData}"></textarea><br>
    </div>
    <div>
        评价指标-准确率：<input class="form-control" type="text" th:value="${classifierResult.evalValue}" name="evalValue"></span><br>
    </div>
</div>

<!--朴素贝叶斯个性化展示部分-->
<div id="naive_bayes_class_result_imgage" style="display: none">
    <div>
        特征变量的重要程度：
        <textarea name="modelData" type="text"  style="width: 100%;resize: none;" rows="4" class="form-control" th:text="${classifierResult.modelData}"></textarea><br>
    </div>
    <div>
        评价指标-准确率：<input class="form-control" type="text" th:value="${classifierResult.evalValue}" name="evalValue"></span><br>
    </div>
</div>

<!--随机森林个性化展示部分-->
<div id="randon_forest_class_result_imgage" style="display: none">
    <div>
        特征变量的重要程度：
        <textarea name="modelData" type="text"  style="width: 100%;resize: none;" rows="4" class="form-control" th:text="${classifierResult.modelData}"></textarea><br>
    </div>
    <div>
        评价指标-准确率：<input class="form-control" type="text" th:value="${classifierResult.evalValue}" name="evalValue"></span><br>
    </div>
</div>

<!--朴素贝叶斯个性化展示部分-->
<div id="svc_class_result_imgage" style="display: none">
    <div>
        特征变量的重要程度：
        <textarea name="modelData" type="text"  style="width: 100%;resize: none;" rows="4" class="form-control" th:text="${classifierResult.modelData}"></textarea><br>
    </div>
    <div>
        评价指标-准确率：<input class="form-control" type="text" th:value="${classifierResult.evalValue}" name="evalValue"></span><br>
    </div>
</div>

<!--线性回归个性化展示部分-->
<div id="linear_regression_result_imgage" style="display: none">
    <div>
        预测结果效果图： <br>
        <img th:src="'/file/'+${classifierResult.predDisImage}" width="500" /><br>
    </div>
    <div>
        特征变量的权重：
        <textarea name="modelData" type="text"  style="width: 100%;resize: none;" rows="4" class="form-control" th:text="${classifierResult.modelData}"></textarea><br>
    </div>
    <div>
        评价指标-RMSE：<input class="form-control" type="text" th:value="${classifierResult.evalValue}" name="evalValue"></span><br>
    </div>
</div>

<!--XGB回归个性化展示部分-->
<div id="xgb_regression_result_imgage" style="display: none">
    <div>
        预测结果效果图： <br>
        <img th:src="'/file/'+${classifierResult.predDisImage}" width="500" /><br>
    </div>
    <div>
        特征变量的权重：
        <textarea name="modelData" type="text"  style="width: 100%;resize: none;" rows="4" class="form-control" th:text="${classifierResult.modelData}"></textarea><br>
    </div>
    <div>
        评价指标-RMSE：<input class="form-control" type="text" th:value="${classifierResult.evalValue}" name="evalValue"></span><br>
    </div>
</div>

</body>
<script th:inline="javascript">
    //模型参数显示问题
    var algo_name = [[${algoName}]]
    if (algo_name == "决策树") {
        $("#personal_result_image").replaceWith($("#decision_tree_class_result_imgage"))
        $("#decision_tree_class_result_imgage").show()
    } else if (algo_name == "逻辑回归") {
        $("#personal_result_image").replaceWith($("#logistics_reg_class_result_imgage"))
        $("#logistics_reg_class_result_imgage").show()
    } else if (algo_name == "朴素贝叶斯") {
        $("#personal_result_image").replaceWith($("#naive_bayes_class_result_imgage"))
        $("#naive_bayes_class_result_imgage").show()
    } else if (algo_name == "随机森林") {
        $("#personal_result_image").replaceWith($("#randon_forest_class_result_imgage"))
        $("#randon_forest_class_result_imgage").show()
    } else if (algo_name == "SVC") {
        $("#personal_result_image").replaceWith($("#svc_class_result_imgage"))
        $("#svc_class_result_imgage").show()
    }else if (algo_name == "线性回归") {
        $("#personal_result_image").replaceWith($("#linear_regression_result_imgage"))
        $("#linear_regression_result_imgage").show()
    } else if (algo_name == "XGB") {
        $("#personal_result_image").replaceWith($("#xgb_regression_result_imgage"))
        $("#xgb_regression_result_imgage").show()
    }
</script>
</html>
